<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    <meta charset="UTF-8">
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta http-equiv="X-UA-Compatible" content="IE-edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="{% static 'yan/slide-unlock.css' %}">
    <style>
        html, body, h1 {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #393939;
            color: #d5d4ff;
        {#overflow: hidden#}
        }

    </style>
</head>
<body>
<form action="" method="post">
    <div>
        <h1 style="margin: 30px auto;width: 300px;height: 40px; "><font size="+4">登录</font></h1>
        <div id="input_1">


            登录名:<input type="text" name="loginname" id="loginname">
            <br>
            密码:<input type="text" name="password" id="password">
        </div>


        <div id="slider">


            <div id="slider_bg"></div>
            <span id="label">>></span>
            <span id="labelTip">Slide To Unlock</span>
        </div>


        <div id="input_2">

            <input type="submit" value="登录" id="but">
        </div>


        <script src="{% static 'yan/jquery-1.12.1.min.js' %}"></script>
        <script src="{% static 'yan/jquery.slideunlock.js' %}"></script>


        <script>
            $(function () {
                var verification;


                var slider = new SliderUnlock("#slider", {}, function () {
                    verification = true;
                });

                slider.init();

                $("#but").click(function () {
                    if ($("#loginname").val() == '') {
                        alert('账号不能为空啊')
                        return false;
                    }
                    if ($("#password").val() == '') {
                        alert('密码不能为空啊')
                        return false;
                    }
                    if (!verification) {
                        alert('请滑动验证码啊')
                        return false;
                    }
                });
            })
        </script>

    </div>

</form>
</body>
</html>